<?php

// 赋值运算符
$name = 'php';

$title  = "php\n 7.2";
$title2 = 'php\n 7.2';

echo '<pre>';
var_dump($title, $title2);
echo '</pre>';

$output = `git`;
// echo "<pre>$output</pre>";

$a = "The People's" . " Republic of China";
echo $a;

// 流程控制

// 分支

$weight = 110;
if ($weight > 130) {
	echo "<br>" . "多锻炼";
} else {
	echo "<br>" . "继续保持";
}
// 循环
// $i = 0;
// while ($i <= 10) {
// 	echo $i++;
// }

for ($i = 0; $i < 10; $i++) {
	echo $i;
}

function p($value = '') {
	echo "<pre>";
	var_dump($value);
	echo "</pre>";
}

for ($i = 0; $i < 10; $i++) {
	p($i);
}

// 数组
//
$a1 = array('name' => 'yangjh', 'age' => 42, 'salary' => 30000);

p($a1);

foreach ($a1 as $key => $value) {
	echo "<br>";
	echo "key '" . $key . "'的值是" . $value;
}
p($a1['age']);
